package com.knife.common.utils;

import java.beans.Transient;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

import static com.knife.common.utils.KnifeStringUtil.camelhumpToUnderline;

/**
 * Created with IntelliJ IDEA.
 *
 * @author： 76875
 * @date： 2022/4/6 星期三 18:19
 * @description：
 * @modifiedBy：
 * @version: 1.0
 */
public class EntityFieldUtil {

    public static void test(Class<?> clazz) {
        Field[] declaredFields = clazz.getDeclaredFields();
        for (Field field : declaredFields) {
            if (Modifier.isPublic(field.getModifiers()) && Modifier.isStatic(field.getModifiers()) && Modifier.isFinal(field.getModifiers())) {

            } else if (field.isAnnotationPresent(Transient.class)) {

            } else {
                String name = field.getName();
                String s = camelhumpToUnderline(name);
                System.out.println("public static final String FIELD_" + s + " = " + "\"" + name + "\"" + ";");
            }
        }
    }
}
